package cn.edu.ctbu.myfirstweb.service.impl;

import cn.edu.ctbu.myfirstweb.dao.AdministratorRepository;
import cn.edu.ctbu.myfirstweb.domain.Administrator;
import cn.edu.ctbu.myfirstweb.service.AdministratorService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class AdminitratorImpService implements AdministratorService {
    @Autowired
    AdministratorRepository administratorRepository;

    public Administrator getAdministrator(Long id) {
        return administratorRepository.getById(id);
    }

    public Administrator login(Long id, String password) {
        return administratorRepository.findByIdAndPassword(id, password);
    }
}
